package com.fun.feifun.modules.sys.user.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fun.feifun.modules.sys.user.model.SysUser;
import com.fun.feifun.modules.sys.user.dao.SysUserMapper;
import com.fun.feifun.modules.sys.user.service.ISysUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 系统用户 服务实现类
 * </p>
 *
 * @author wkf
 * @since 2023-07-03
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {

    /**
     * 根据用户名获取用户
     * @param userName
     * @return
     */
    @Override
    public SysUser getByUserName(String userName){
        QueryWrapper<SysUser> query=new QueryWrapper();
        query.lambda().eq(SysUser::getUserName,userName);
        return this.getOne(query);
    }

}
